<?php

include_once "function_xml_basic.php";


function GetXmlProtocolObjectList($type)
{
	$root_path = "/MINI/RESOURCES/OBJECTS/PROTOCOLCLASS";
	$query_string = $root_path. "/ATOM/OBJECT[@ProtocolType='". $type. "']";
	$key_array = array('Name','Protocol', 'Desc',
			   'Apply', 'ProtocolType', 'ObjectType');
	return GetAttributList($query_string, $key_array);
}

function GetXmlBaseProtocolObjectList()
{ 	
	$ret_list = GetXmlProtocolObjectList("1");
	return $ret_list;
}
function GetXmlExtraProtocolObjectList()
{
	$ret_list = GetXmlProtocolObjectList("2");
	return $ret_list;
}
function GetXmlFileProtocolObjectList()
{
	$ret_list = GetXmlProtocolObjectList("3");
	return $ret_list;
}

function GetXmlProtocolObjectByName($name)
{
	$root_path = "/MINI/RESOURCES/OBJECTS/PROTOCOLCLASS";
	$query_string = $root_path. "/ATOM/OBJECT[@Name='". $name. "']";
	$key_array = array('Name','Protocol', 'Desc',
			   'Apply', 'ProtocolType', 'ObjectType');
	$list = GetAttributList($query_string, $key_array);
	foreach ($list as $l)
	{
		if ($l['Name'] != '')
		{
			$ret = $l['Protocol'];
			break;
		}	
	}	
	return $ret;
}

?>
